1. Field of the Invention
The present invention relates to entropy encoding that is widely used in lossless encoding of audio, images, and the like and also relates to an encoding method and apparatus for realizing high encoding efficiency and to a program therefor.
2. Description of the Related Art
Entropy encoding that is widely used in lossless encoding of audio, images, and the like, in particular, Golomb-Rice encoding, is a high-speed and simple technique in that it can be executed using only easy computations, such as shift computation and bit mask computations. This method is designed in such a manner that signals are individually divided at a certain bit position, the high-order bits are variable-length-encoded, and the low-order bits are fixed-length-encoded. For variable-length encoding, a method is often used in which a numerical value represented by the high-order bits is proportional to an encoded word length (see, for example, Japanese Unexamined Patent Application Publication No. 2006-140772).